﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ZLCMS.Business.UploadFileInfo;
using Newtonsoft.Json;

namespace ZLCMS.Web.SystemManage.Control
{
    public partial class SinglePictureControl : System.Web.UI.UserControl
    {
        public SinglePictureControl()
        {
            ImageWidth = 200;
            ImageHeight = 200;
        }

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        public int ImageWidth { get; set; }

        public int ImageHeight { get; set; }

        public string Value
        {
            get { return value_json.Value; }

            set { value_json.Value = value; }
        }

        public bool HiddenBtn
        {
            get;set;
        }

        /// <summary>
        /// 上传文件基本配置
        /// </summary>
        public UploadConfig Config
        {
            get;
            set;
        }

        protected string ConfigJSON
        {
            get
            {
                if (Config == null)
                {
                    return JsonConvert.SerializeObject(new UploadConfig() { UploadDir = "TEMP" });
                }
                else
                {
                return JsonConvert.SerializeObject(Config);
                }
            }
        }
    }
}